package www.wmx.com.xssc.util.enumUtil;

public enum CgType {

    ZL(0, "专利"),
    RJZZQ(1, "软件著作权"),
    JSMM(2, "技术秘密"),
    LW(3,"论文"),
    ZZ(4,"专著"),
    BZ(5,"标准");

    private final int code;
    private final String message;

    //构造函数为每个枚举实例赋值
    CgType(int code, String message) {
        this.code = code;
        this.message = message;
    }

    // 获取错误代码
    public int getCode() {
        return code;
    }

    // 获取错误信息
    public String getMessage() {
        return message;
    }

    // 根据错误代码获取枚举实例
    public static ErrorCode getByCode(int code,int type) {
        for (ErrorCode errorCode : ErrorCode.values()) {
            if (errorCode.getCode() == code) {
                return errorCode;
            }
        }
        return null;
    }

}
